package com.renjibo.toolbardemo;

import android.app.Application;
import android.util.Log;
import android.view.ViewConfiguration;

import java.lang.reflect.Field;

import static android.content.ContentValues.TAG;

/**
 * 任继波
 * Created by Administrator on 2017/6/27.
 */

public class App extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
//        makeActionOverflowMenuShown();
    }

    private void makeActionOverflowMenuShown() {
        //devices with hardware menu button (e.g. Samsung Note) don't show action overflow menu
        try {
            ViewConfiguration config = ViewConfiguration.get(this);
            Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
            if (menuKeyField != null) {
                menuKeyField.setAccessible(true);
                menuKeyField.setBoolean(config, false);
            }
        } catch (Exception e) {
            Log.d(TAG, e.getLocalizedMessage());
        }
    }
}
